<!DOCTYPE html>
<html>
<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script>
		var timer;
		function start(){
			if(timer){
				return
			}
			timer = setInterval(function(){
				var now = new Date();
				var time = now.toLocaleTimeString();,
				var c = document.getElementById("clock");
				c.innerHTML = time;
			},1000);
		}
		function stop(){
			clearInterval(timer);
		}
	</script>
	<body >
		<h1>动态时钟</h1>
		<p>
			<input type="button" value="start" onclick="start()" />
			<input type="button" value="stop" onclick="stop()" />
		</p>
		<p style="border: 1px solid red;height: 100px;width: 200px;">
			<span id="clock" style="color:black;font-size: 30px;"/> </span>
		</p>
		 
	</body>
</html>